Online-Academy

Look, Read, Understand, Apply

Menu

OOAD - Object Oriented Analysis and Design

Use Case

Use Case

Use case is a process of the software system which users can perform. Use case shows the interaction between users and the system; users are termed as actors. Actors are of two types; actors can be internal or external; actors can be human being, software components, or devices.

  • Primary Actor: actors who uses the system and stays outside of the system.
  • Secondary Actor: actors who reacts to the actions of the primary actors. They are part of the system.

Relationship between use cases

There are basically three types of relationships between use cases:

  • Extends: if a use case “A” is intended to use behavior of another use case “B”, then use case “A” extends use case “B”; use case “B” is called extending use case and it is not always executed, its execution depends on some condition, it is dependent on use case “A”. Use case “A” independent of use case “B”, it can exist on own.
  • Includes: a use case “A” includes use case “B”, “A” is based use case and “B” is included use case. Use case “A” is not complete without use case “B”; included use case “B” is mandatory.
  • Generalization: If two use cases “A” and “B” have common behaviors and also have specific behaviors then use cases are generalized. The common behavior of the use cases “A” and “B” are kept in base use case, more general use case, and use case “A” and “B” are specialized from the base use case.

Use Case Example

Actor: Bank Client. The bank client must be able to withdraw money from his or her bank account from the ATM.

Pre-Condition:

  • The client must have a valid ATM card
  • The ATM must be in network and connection must be active
  • The ATM must have some cash

Description: The bank client interacts with the ATM system using his/her card; Card and PIN are verified by the system; if the card or PIN is not valid system displays invalid card or invalid PIN; user is given three changes to validate card or PIN; if the client is not able to provide correct card or PIN after three chances card will be taken inside the ATM, user will not get his or her card back; if the card and PIN are correct then client performs the withdraw process using the menu of the ATM system. During the withdraw process balance verification process is performed by the system. If there is no sufficient balance in the account of the client; system asks to re-enter amount; client will be provided three times to enter valid amount; if the client is not able to provide valid amount in three attempts, the card will be taken inside the ATM system; if the amount provided is valid then the ATM system dispenses cash and ejects the card. Client gets cash and card.

Post Condition: The bank client get cash; The bank account of the bank client is updated